package com.reger.l2cache.core;

import java.io.Serializable;

import org.springframework.util.SerializationUtils;

public class Relust<T> implements Serializable{
 
	private static final long serialVersionUID = 1L;

	public static final Relust<Void> NULL=new Relust<Void>();
	
	public static final byte[] NULL_BYTE=SerializationUtils.serialize(NULL);

	private final Throwable throwable;
	private final T relust;
	private final Boolean isNull;

	
	
	public Relust(Throwable throwable) {
		super();
		this.throwable = throwable;
		this.relust = null;
		this.isNull = false;
	}

	public Relust(T relust) {
		super();
		this.throwable = null;
		this.relust = relust;
		this.isNull = false;
	}

	public Relust() {
		super();
		this.throwable = null;
		this.relust = null;
		this.isNull = true;
	}

	public Throwable getThrowable() {
		return throwable;
	}

	public T getRelust() {
		return relust;
	}

	public Boolean getIsNull() {
		return isNull;
	}
}
